package com.job.Gai_Yian.Homework0716;

import com.sun.xml.internal.txw2.DatatypeWriter;

import java.util.Calendar;

/**
 * @author Gai_Yian
 * @version 1.0
 * @since 2022-07-16 16:09:41
 */
public class UseCalender {
    public static void main(String[] args) {
        Calendar now = Calendar.getInstance();
        System.out.println(now);

        int year=now.get(Calendar.YEAR);
        int month=now.get(Calendar.MONTH)+1;
        int day=now.get(Calendar.DAY_OF_MONTH);
        System.out.println(year+"-"+month+"-"+day);

        now.add(Calendar.YEAR,-39);
        System.out.println(now);


    }
}
